<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<html>
<head>
    <title>登录页</title>
    <%--echart线图、柱状图、饼图等各种图型库 cdn--%>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <%--jquery cdn--%>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
欢迎${phone} 登录
欢迎${nickName} 绑定
<img src="${avatarUrl}">

<a href="https://gitee.com/oauth/authorize?client_id=ca4486894365919ca54674dda5d4274620f8605657f2982d6d5e2b8ea8000083&redirect_uri=http://localhost:8080/callbackCode.do&response_type=code
">用户昵称</a>
<h1>----------------------------------------------------------</h1>

<form action="/list.do">

    学生<input name="studentName"><br>
    宿舍<input name="roomName"><br>
    宿舍楼<input name="apartmentName"><br>
    <input type="submit" value="查询">
    <input type="button" onclick="excel()" value="导出">
    <a href="/addPage.do">入住</a>


    <table>
        <tr>
            <td>宿舍楼</td>
            <td>宿舍</td>
            <td>宿舍图片</td>
            <td>学生</td>
            <td>入住时间</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="s">
            <tr>
                <td>${s.apartmentName}</td>
                <td>${s.roomName}</td>
                <td><img src="${s.pic}" style="height: 50px;width: 50px"></td>
                <td>${s.studentName}</td>
                <td>${s.createTime}</td>
            </tr>
        </c:forEach>
    </table>
</form>
<script>
    function excel() {

        let studentName = $('[name=studentName]').val();
        let roomName = $('[name=roomName]').val();
        let apartmentName = $('[name=apartmentName]').val();
        location.href = '/studentExcel.do?studentName=' + studentName +'&roomName=' + roomName + '&apartmentName=' + apartmentName
    }
</script>

</body>
</html>